package com.dgh.school.mapper;

import com.dgh.school.bean.Schedule;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ScheduleMapper {
    @Select("select * from tb_schedule")
    List<Schedule> selectAll();
    //添加
    @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
    @Insert("insert into tb_schedule values (default,#{id},#{workTime},#{taskName})")
    void insertData(Schedule schedule);

    //删除
    @Delete("delete from tb_schedule where id=#{id}")
    void deleteSchedule(int id);

    //编辑
    @Update("update tb_schedule set id=#{id},workTime=#{workTime},taskName=#{taskName}")
    void updateData(Schedule schedule);
}
